﻿using System.Linq;
using ZBJF.Warranty.Common.Enums.System;
using ZBJF.Warranty.Model;
using ZBJF.Warranty.Model.ViewModel.BaseQueryModel;
using ZBJF.Warranty.Model.ViewModel.Log;

namespace ZBJF.Warranty.IBLL
{
    public partial interface IOpreateLogsService
    {
        OpreateLogs Load(long id);
        /// <summary>
        /// 获取最近一条操作记录
        /// </summary>
        /// <param name="logTableName"></param>
        /// <param name="logTablePKID"></param>
        /// <returns></returns>
        OpreateLogs LoadLastOpreateLog(string logTableName, long logTablePKID);
        bool Add(OpreateLogs entity);
        IQueryable<OpreateLogs> GetPagingList(OpreateLogsModel model, out int total);
        /// <summary>
        /// 获取数据库表字段说明
        /// </summary>
        /// <param name="tableName"></param>
        /// <param name="fieldName"></param>
        /// <returns></returns>
        string GetFieldDesc(string tableName, string fieldName);
         /// <summary>
         ///写入操作日志
         /// </summary>
         /// <typeparam name="T1"></typeparam>
         /// <typeparam name="T2"></typeparam>
         /// <param name="entity">日志类</param>
         /// <param name="source"></param>
         /// <param name="current"></param>
         /// <param name="type">操作类型</param>
         /// <returns></returns>
        bool AddOpreateLogs<T1, T2>(OpreateLogs entity, T1 source, T2 current, OpreateType type = OpreateType.Update);

    }
}